package com.treetao.union.mall.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.extension.service.IService;
import com.treetao.union.db.model.MallTopic;
import com.treetao.union.db.model.vo.RestResponse;
import com.treetao.union.db.service.MallTopicService;
import com.treetao.union.mall.api.base.BaseCURDController;
import com.treetao.union.mall.api.vo.req.ReqParam;

@RestController
@RequestMapping("/mall/topic")
public class MallTopicController extends BaseCURDController {
	@Autowired
	private MallTopicService mallTopicService;

	@Override
	protected IService<?> getCommonService() {
		return mallTopicService;
	}
	@Override
	protected boolean setCommonDataAuth() {
		return false;
	}
	
	@Override
	protected RestResponse detail() {
		ReqParam param = getMappingReqParam();
		Long topicId = param.getLong("topicId", false);
		return RestResponse.success(mallTopicService.getTopicDetailAndSkus(topicId));
	}
}
